<!--
/**************************************************
* @ marketinfoadd.jsp
*
* Copyright   2005 Hitrust Technology Inc.
* Developed by SDC, Hitrust.
* All Rights Reserved.
*
* Modify History:
*  v1.00, 2006/05/26, Jenny Li
*  1) first release
/**************************************************
-->
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="../../common.jsp" %>    
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>市场信息新增</title>
		<LINK href="<%=root%>/css/caigouxitong.css" type=text/css rel=stylesheet>
		<SCRIPT language="JavaScript" src="<%=root%>/js/common.js"></SCRIPT>
		<SCRIPT language="JavaScript" src="<%=root%>/js/calendar.js"></SCRIPT>		
		<script language="JavaScript">
	var counter;
	
	String.prototype.length2 = function() {
		var cArr = this.match(/[^x00-xff]/ig);
		return this.length + (cArr == null ? 0 : cArr.length); 
	}
	
	function process(option){
		if(option == 'S'){
			if(isEmpty(marketinfoaddform.newTitle.value)){
				alert("市场信息标题不能为空！");
				return false;
			}
			if(isEmpty(marketinfoaddform.newPublishDate.value)){
				alert("市场信息发布日期不能为空！");
				return false;				
			}
			if(isEmpty(marketinfoaddform.newProvider.value)){
				alert("供应商不能为空！");
				return false;				
			}			
			if(marketinfoaddform.textarea1.value.length2() > 800){
				alert("市场信息内容超长！");
				return false;				
			}
			
		   	marketinfoaddform.action = "<%=response.encodeURL(root + "/A401109.do")%>";
		   	marketinfoaddform.submit();
		}else if(option == 'CW'){
			//window.opener.location.href = window.opener.location.href;
			window.close();
		}
	}
	function openwin(value){
		showModalDialog(value,window,"status:yes;unadorned:yes;dialogWidth:375px;dialogHeight:400px;help:no;");
	}
    function writeback(){
		window.close();		
	}
	function selectCompany()
	{
		  var url = "<%=response.encodeURL(root+"/A401103.do")%>";
          var returnv = window.open(url,null," edge: sunken ,center: Yes, help: No, resizable: Yes, status: No,height=580px, scrollbars=yes");
			//openwin(url);
	}		
			</script>
	</head>

	<body BGCOLOR="#f2f2f2" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
		<form name="marketinfoaddform" method="post" ENCTYPE="multipart/form-data">
			<input type='hidden' name='requery'>
			<p><br>
			</p>
			<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
				<tr>
					<td width="100%" height="20">
						<table width="100%" border="0" cellspacing="0" cellpadding="1">
							<tr height="20">
								<td height="30" width="758" class="mtxt_black">市场信息详细</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td class="bg_line" height="2"></td>
				</tr>
			</table>
			<br>
			<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
				<tr>
					<td width="100%">
						<table class="bg_table" id="tableId" cellspacing="1" cellpadding="0" style="PADDING-RIGHT:
							 5px; PADDING-LEFT:
							 5px" width="100%" align="center" border="0">
							<TR height="30">
								<TD class="bg_column" align="center" width="10%">
									信息标题&nbsp;
								</TD>
								<TD align="left" class="bg_row_odd" width="50%">
								<INPUT style="WIDTH: 90%" size="10" maxlength="500" name="newTitle"></TD>
								<TD class="bg_column" align="center" width="10%">发布日期</TD>
								<TD align="left" class="bg_row_odd" width="30%">
								<INPUT id="text1" name="newPublishDate" style="WIDTH: 110px; HEIGHT: 21px" size="20" value="<%=request.getParameter("publishDateStr")==null? DateUtil.getCurrentDate("yyyy-MM-dd"):request.getParameter("publishDateStr")%>" length="20" onfocus="setday(this)" readonly></TD>
							</TR>
							<tr height="30">
								<TD class="bg_column" align="center">调价供应商</TD>
								<TD class="bg_row_odd" colspan="3">
						<input type="text" id="provider_name" name="newProviderName" readonly >					
						<input type="button" class="kuang" value="选择供应商" onClick="selectCompany();">
						<input type="hidden" class="kuang" id="provider_id" name="newProvider" value="<%=request.getAttribute("provider_id") == null? "":request.getAttribute("provider_id")%>">						
								</TD>
							</tr>
							<tr height="30">
								<TD class="bg_column" align="center">内容</TD>
								<TD class="bg_row_odd" colspan="3"><TEXTAREA id="textarea1" style="WIDTH: 98%" name="newContent" rows="10"></TEXTAREA>
								</TD>
							</tr>
							<tr height="30">
								<TD class="bg_column" align="center">相关文件</TD>
								<TD class="bg_row_odd" colspan="3">
									<INPUT type="file" id="file1" name="fileName" style="WIDTH: 241px; HEIGHT: 21px" size="24">
								</TD>
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</form>
		<p align="center"><INPUT type="button" value="保存" ID="Button1" class="kuang" onclick="process('S')">&nbsp; 
			&nbsp; <INPUT type="button" value="关闭" ID="Button1" class="kuang" onclick="process('CW')">&nbsp;
		</p>
	</body>
</html>
